# -*- coding: UTF-8 -*-

"""
@File    : utils.py
@Time    : 2020/04/04--12:33
@Author  : YanMing
@Email   : 476588294@qq.com
@Software: PyCharm 2020.2 + Python 3.7.2
"""

import socket
import uuid


def get_user_info():
    # 获取主机名
    hostname = socket.gethostname()
    # 获取IP
    ip = socket.gethostbyname(hostname)
    # 获取Mac地址
    mac = "-".join([uuid.UUID(int=uuid.getnode()).hex[-12:][e:e + 2] for e in range(0, 11, 2)]).upper()
    return hostname, ip, mac
